﻿using OpenCvSharp;
using System.Collections;
using System.Collections.Generic;
using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    /// <summary>
    /// 翻转过滤器
    /// </summary>
    [Filter("图像翻转",FilterType.Algorithm)]
    public class AlgorithmFlip : FilterBase
    {
        /// <summary>
        /// 翻转模式
        /// </summary>
        [InputParameter("翻转模式")]
        public FlipMode FlipMode { get; set; }
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            Mat mat1 = new Mat();
            Cv2.Flip(mat, mat1, FlipMode);
            return ResultData<Mat>.Accept(TextResource.image_flip_complete, mat1);
        }
    }
}
